<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9"/>
<title>NGUI: InvGameItem Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">NGUI
   &#160;<span id="projectnumber">3.11.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_inv_game_item.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="class_inv_game_item-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">InvGameItem Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Since it would be incredibly tedious to create thousands of unique items by hand, a simple solution is needed. Separating items into 2 parts is that solution. Base item contains stats that the item would have if it was max level. All base items are created with their stats at max level. Game item, the second item class, has an effective item level which is used to calculate effective item stats. Game items can be generated with a random level (clamped within base item's min/max level range), and with random quality affecting the item's stats.  
 <a href="class_inv_game_item.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a882e1b9c37b95a0e3b4bf7e5b7598e58"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a882e1b9c37b95a0e3b4bf7e5b7598e58"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Quality</b> { <br />
&#160;&#160;<b>Broken</b>, 
<b>Cursed</b>, 
<b>Damaged</b>, 
<b>Worn</b>, 
<br />
&#160;&#160;<b>Sturdy</b>, 
<b>Polished</b>, 
<b>Improved</b>, 
<b>Crafted</b>, 
<br />
&#160;&#160;<b>Superior</b>, 
<b>Enchanted</b>, 
<b>Epic</b>, 
<b>Legendary</b>, 
<br />
&#160;&#160;<b>_LastDoNotUse</b>
<br />
 }</td></tr>
<tr class="separator:a882e1b9c37b95a0e3b4bf7e5b7598e58"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abf8e4c5ec66904170ef9e438bfe5aa47"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#abf8e4c5ec66904170ef9e438bfe5aa47">InvGameItem</a> (int id)</td></tr>
<tr class="memdesc:abf8e4c5ec66904170ef9e438bfe5aa47"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a game item with the specified ID.  <a href="#abf8e4c5ec66904170ef9e438bfe5aa47">More...</a><br /></td></tr>
<tr class="separator:abf8e4c5ec66904170ef9e438bfe5aa47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01f6b6f152dedbcf00ce8810a31c6156"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#a01f6b6f152dedbcf00ce8810a31c6156">InvGameItem</a> (int id, <a class="el" href="class_inv_base_item.html">InvBaseItem</a> bi)</td></tr>
<tr class="memdesc:a01f6b6f152dedbcf00ce8810a31c6156"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a game item with the specified ID and base item.  <a href="#a01f6b6f152dedbcf00ce8810a31c6156">More...</a><br /></td></tr>
<tr class="separator:a01f6b6f152dedbcf00ce8810a31c6156"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a503e99d875529b7c782a2f78da6295be"><td class="memItemLeft" align="right" valign="top">List&lt; <a class="el" href="class_inv_stat.html">InvStat</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#a503e99d875529b7c782a2f78da6295be">CalculateStats</a> ()</td></tr>
<tr class="memdesc:a503e99d875529b7c782a2f78da6295be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate and return the list of effective stats based on item level and quality.  <a href="#a503e99d875529b7c782a2f78da6295be">More...</a><br /></td></tr>
<tr class="separator:a503e99d875529b7c782a2f78da6295be"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:abdc95504340f4cf0a485eaac31623725"><td class="memItemLeft" align="right" valign="top">Quality&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#abdc95504340f4cf0a485eaac31623725">quality</a> = Quality.Sturdy</td></tr>
<tr class="memdesc:abdc95504340f4cf0a485eaac31623725"><td class="mdescLeft">&#160;</td><td class="mdescRight">Item quality &ndash; applies a penalty or bonus to all base stats.  <a href="#abdc95504340f4cf0a485eaac31623725">More...</a><br /></td></tr>
<tr class="separator:abdc95504340f4cf0a485eaac31623725"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa132ff16c490b26fdef58480f31359ef"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#aa132ff16c490b26fdef58480f31359ef">itemLevel</a> = 1</td></tr>
<tr class="memdesc:aa132ff16c490b26fdef58480f31359ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Item's effective level.  <a href="#aa132ff16c490b26fdef58480f31359ef">More...</a><br /></td></tr>
<tr class="separator:aa132ff16c490b26fdef58480f31359ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:add0f5894fca51f2c6127ea31af7af036"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#add0f5894fca51f2c6127ea31af7af036">baseItemID</a><code> [get]</code></td></tr>
<tr class="memdesc:add0f5894fca51f2c6127ea31af7af036"><td class="mdescLeft">&#160;</td><td class="mdescRight">ID of the base item used to create this one.  <a href="#add0f5894fca51f2c6127ea31af7af036">More...</a><br /></td></tr>
<tr class="separator:add0f5894fca51f2c6127ea31af7af036"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a09a08ce3bd8454b415bb7900313a94dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_inv_base_item.html">InvBaseItem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#a09a08ce3bd8454b415bb7900313a94dd">baseItem</a><code> [get]</code></td></tr>
<tr class="memdesc:a09a08ce3bd8454b415bb7900313a94dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Base item used by this game item.  <a href="#a09a08ce3bd8454b415bb7900313a94dd">More...</a><br /></td></tr>
<tr class="separator:a09a08ce3bd8454b415bb7900313a94dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa923a5b7e11545ec108776bb45bd9635"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#aa923a5b7e11545ec108776bb45bd9635">name</a><code> [get]</code></td></tr>
<tr class="memdesc:aa923a5b7e11545ec108776bb45bd9635"><td class="mdescLeft">&#160;</td><td class="mdescRight">Game item's name should prefix the quality  <a href="#aa923a5b7e11545ec108776bb45bd9635">More...</a><br /></td></tr>
<tr class="separator:aa923a5b7e11545ec108776bb45bd9635"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1739fc4aa2c7db2b27850f04534f56c7"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#a1739fc4aa2c7db2b27850f04534f56c7">statMultiplier</a><code> [get]</code></td></tr>
<tr class="memdesc:a1739fc4aa2c7db2b27850f04534f56c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Put your formula for calculating the item stat modifier here. Simplest formula &ndash; scale it with quality and item level. Since all stats on base items are specified at max item level, calculating the effective multiplier is as simple as itemLevel/maxLevel.  <a href="#a1739fc4aa2c7db2b27850f04534f56c7">More...</a><br /></td></tr>
<tr class="separator:a1739fc4aa2c7db2b27850f04534f56c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18d6e3625e4483ee268d6723c90c98a1"><td class="memItemLeft" align="right" valign="top">Color&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_inv_game_item.html#a18d6e3625e4483ee268d6723c90c98a1">color</a><code> [get]</code></td></tr>
<tr class="memdesc:a18d6e3625e4483ee268d6723c90c98a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Item's color based on quality. You will likely want to change this to your own colors.  <a href="#a18d6e3625e4483ee268d6723c90c98a1">More...</a><br /></td></tr>
<tr class="separator:a18d6e3625e4483ee268d6723c90c98a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Since it would be incredibly tedious to create thousands of unique items by hand, a simple solution is needed. Separating items into 2 parts is that solution. Base item contains stats that the item would have if it was max level. All base items are created with their stats at max level. Game item, the second item class, has an effective item level which is used to calculate effective item stats. Game items can be generated with a random level (clamped within base item's min/max level range), and with random quality affecting the item's stats. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abf8e4c5ec66904170ef9e438bfe5aa47"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">InvGameItem.InvGameItem </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a game item with the specified ID. </p>

</div>
</div>
<a class="anchor" id="a01f6b6f152dedbcf00ce8810a31c6156"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">InvGameItem.InvGameItem </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_inv_base_item.html">InvBaseItem</a>&#160;</td>
          <td class="paramname"><em>bi</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a game item with the specified ID and base item. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a503e99d875529b7c782a2f78da6295be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">List&lt;<a class="el" href="class_inv_stat.html">InvStat</a>&gt; InvGameItem.CalculateStats </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate and return the list of effective stats based on item level and quality. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="aa132ff16c490b26fdef58480f31359ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int InvGameItem.itemLevel = 1</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Item's effective level. </p>

</div>
</div>
<a class="anchor" id="abdc95504340f4cf0a485eaac31623725"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Quality InvGameItem.quality = Quality.Sturdy</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Item quality &ndash; applies a penalty or bonus to all base stats. </p>

</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="a09a08ce3bd8454b415bb7900313a94dd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_inv_base_item.html">InvBaseItem</a> InvGameItem.baseItem</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Base item used by this game item. </p>

</div>
</div>
<a class="anchor" id="add0f5894fca51f2c6127ea31af7af036"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int InvGameItem.baseItemID</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>ID of the base item used to create this one. </p>

</div>
</div>
<a class="anchor" id="a18d6e3625e4483ee268d6723c90c98a1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Color InvGameItem.color</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Item's color based on quality. You will likely want to change this to your own colors. </p>

</div>
</div>
<a class="anchor" id="aa923a5b7e11545ec108776bb45bd9635"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">string InvGameItem.name</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Game item's name should prefix the quality </p>

</div>
</div>
<a class="anchor" id="a1739fc4aa2c7db2b27850f04534f56c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float InvGameItem.statMultiplier</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">get</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Put your formula for calculating the item stat modifier here. Simplest formula &ndash; scale it with quality and item level. Since all stats on base items are specified at max item level, calculating the effective multiplier is as simple as itemLevel/maxLevel. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/WorkDir/Unity3D_Work/taidou_arpg/Assets/NGUI/Examples/Scripts/InventorySystem/System/InvGameItem.cs</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_inv_game_item.html">InvGameItem</a></li>
    <li class="footer">Generated on Sat Jan 4 2020 22:30:27 for NGUI by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9 </li>
  </ul>
</div>
</body>
</html>
